from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib.auth.views import login, logout_then_login
from django.views.generic.simple import direct_to_template
import ourcity.core.feeds as cf

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    (r'', include('ourcity.core.urls')),
    (r'^accounts/', include('ourcity.registration.urls')),
    (r'^blog/', include('ourcity.news.urls_blog')),
    (r'^comments/', include('django.contrib.comments.urls')),
    (r'^feeds/', include('ourcity.news.urls_feeds')),
    (r'^issues/', include('ourcity.issues.urls')),
    (r'^profiles/', include('ourcity.profiles.urls')),
    (r'^reports/', include('ourcity.news.urls_reports')),
    (r'^reps/', include('ourcity.reps.urls')),
    (r'^elections/', include('ourcity.elections.urls')),

    (r'^admin/doc/', include('django.contrib.admindocs.urls')),
    (r'^admin/', include(admin.site.urls)),

)

urlpatterns += patterns('django.views.generic.simple', 
    (r'^reps/profile$', 'direct_to_template', {'template': 'reps/profile.html'})
)

# Use the Django server to serve the static content in development.
if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^media/(?P<path>.*)$', 'django.views.static.serve',
            {'document_root': settings.MEDIA_ROOT}),
    )

